<template>
    <div>
        <home-header></home-header>
        <home-swiper :swiperList="swiperList"></home-swiper>
        <home-icons :iconsList="iconsList"></home-icons>
        <home-location></home-location>
        <public-line></public-line>
        <home-activity></home-activity>
        <public-line></public-line>
        <home-hot></home-hot>
        <public-line></public-line>
        <home-like :likeList="likeList"></home-like>
        <home-vocation :vocationList="vocationList"></home-vocation>
    </div>
</template>

<script>
import HomeHeader from './pages/Header'
import HomeSwiper from './pages/Swiper'
import HomeIcons from './pages/Icons'
import HomeLocation from './pages/Location'
import HomeActivity from './pages/Activity'
import PublicLine from '../public/Line'
import HomeHot from './pages/Hot'
import HomeLike from './pages/Like'
import HomeVocation from './pages/Vocation'

export default {
    name : "home-page",
    data(){
        return {
            swiperList : [],
            iconsList : [],
            hotList : [],
            likeList : [],
            vocationList : []
        }
    },
    components : {
        "home-header" : HomeHeader,
        "home-swiper" : HomeSwiper,
        "home-icons" : HomeIcons,
        "home-location" : HomeLocation,
        "home-activity" : HomeActivity,
        "public-line" : PublicLine,
        "home-hot" : HomeHot,
        "home-like" : HomeLike,
        "home-vocation" : HomeVocation
    },
    methods : {
        getHomeData : function(){
            this.$axios.get("/api/dataHome.json")
                .then(res => {
                    const data = res.data.data;
                    this.swiperList = data[0].swiperList;
                    this.iconsList =  data[0].iconsList;
                    this.likeList = data[0].likeList;
                    this.vocationList = data[0].vocationList;
                })
                .catch(err =>{
                    console.log(err)
                })
        }
    },
    mounted(){
        this.getHomeData();
    }
}
</script>

<style>

</style>


